package com.java_senior_2;

import java.util.ArrayList;
import java.util.Iterator;

public class EmployeeManager {
    public static void main(String[] args) {
        ArrayList<Employee> list=new ArrayList<>();
        Employee e1=new Employee(001,"zhangsan",18,3000);
        Employee e2=new Employee(002,"lisi",25,3500);
        Employee e3=new Employee(003,"wangwu",22,3200);
        list.add(e1);
        list.add(e2);
        list.add(e3);
        Employee e4=new Employee(003,"zhaoliu",24,3300);
        list.add(1,e4);
        list.remove(e3);
        for (int i = 0; i <list.size() ; i++) {
            list.get(i).print();
        }
        Iterator iterator=list.iterator();
        while(iterator.hasNext()){
            Employee e=(Employee) iterator.next();
            e.work();
        }
    }
}
